<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav shop-header">
          <h1 class="title">STEP2：确认订单</h1>
        </header>
        <div class="content" style="margin-bottom: 2.7rem;">
          
          <div class="list-block media-list payment-list" style="margin-bottom: .5rem;">
            <ul>
              <li>
                <div class="item-content product-info">
                  <div class="item-inner">
                    <div class="item-title-row">
                      <div class="item-title">${order.product.name}</div>
                    </div>
                    <div class="item-text clearfix">
                      <c:if test="${order.orderType.offline}">
                        <p class="pull-left"><span class="color-gray">门店&nbsp;:&nbsp;${order.site.name}</span></p>
                      </c:if>
                      <p class="pull-right"><span><small>￥</small><fmt:formatNumber value="${order.product.currentOffer / 100}"  pattern="0.00" maxFractionDigits="2" /></span>&nbsp;&times;${order.amount}</p>
                    </div>
                  </div>
                </div>
              </li>
              <li>
                <div class="item-content order-info">
                  <div class="item-inner">
                    <div class="item-text">
                      <p>订单编号：${order.code}</p>
                      <p>下单时间：<fmt:formatDate value="${order.createTime}" pattern="yyyy-MM-dd HH:mm"/></p>
                      <c:if test="${not empty coupon}">
                        <p>优惠券：<span class="color-warning">${coupon.templateName}</span></p>
                      </c:if>
                      <c:if test="${not empty order.discountCode}">
                        <p>折扣码：<span class="color-warning">${order.discountCode}</span></p>
                      </c:if>
                    </div>
                  </div>
                </div>
              </li>
              <li>
                <div class="item-content order-amount">
                  <div class="item-inner">
                    <div class="item-text">
                      <p>支付金额：<span><small>￥</small><fmt:formatNumber value="${order.price / 100}"  pattern="0.00" maxFractionDigits="2" /></span></p>
                    </div>
                  </div>
                </div>
              </li>
              <c:if test="${order.orderType.others}">
                <li>
                  <div class="item-content order-info">
                    <div class="item-inner">
                      <div class="item-text">
                        <p>身份证号：${order.attrs['identificationCard'].value}</p>
                        <p>收货地址：${order.attrs['shipping_address'].value}</p>
                      </div>
                    </div>
                  </div>
                </li>
              </c:if>
            </ul>
          </div>
          
          <div class="content-block" style="margin: 0px;">
            <p><a href="#" class="button button-big button-success button-fill order-pay" id="order-confirm"><i class="icon icon-fs-wechat"></i>&nbsp;&nbsp;确认购买</a></p>
            <p class="text-right"><a href="${ctx.host}/orders" style="font-size: .7rem; color: #999;">&nbsp;>>&nbsp;查看订单</a></p>
          </div>
          
        </div>
        <!-- End Content -->
        
        
        
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/trading/online-order-confirm.js" />
    <script type="text/javascript">
      require(['page/trading/online-order-confirm'], function(page) {
        page.init({
          orderId: '${order.id}'
        })
      })
    </script>
    
  </body>
</html>